Skip to content

fix(query-engine): honor CountMinSketch sum/count subtype - #665

Merged
milindsrivastava1997 merged 6 commits into
mainfrom
505-countminsketch-no-heap-ignores-aggregation_sub_type-sumcount-distinction-always-uses-sum-semantics
Sep 2, 2026
Merged

fix(query-engine): honor CountMinSketch sum/count subtype#665
milindsrivastava1997 merged 6 commits into
mainfrom
505-countminsketch-no-heap-ignores-aggregation_sub_type-sumcount-distinction-always-uses-sum-semantics

Conversation

@milindsrivastava1997

@milindsrivastava1997 milindsrivastava1997 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix CountMinSketch configuration semantics by validating subtype and honoring SUM versus COUNT weighting.

Changes

  • Plain CountMinSketch requires aggregation_sub_type to be sum or count (case-insensitive, without trimming).
  • Plain CMS sum uses sample values; count uses unit weights.
  • CountMinSketchWithHeap requires aggregation_sub_type: topk.
  • Heap CMS count_events, when present, must be a boolean; omitted remains the COUNT default.
  • Invalid CMS configurations fail before workers and ingest sources start.
  • Capability matching selects the matching plain-CMS subtype for SUM versus COUNT.
  • The legacy MultipleSubpopulation path is unchanged.

Closes #505.

Tests

  • cargo test -p asap_types --lib
  • cargo test -p query_engine_rust --lib — 594 passed
  • cargo fmt --all
  • cargo check -p query_engine_rust
  • cargo clippy -p query_engine_rust --all-targets -- -D warnings
  • Pre-commit hooks passed.

Follow-ups

@milindsrivastava1997
milindsrivastava1997 marked this pull request as ready for review September 2, 2026 15:02
@milindsrivastava1997
milindsrivastava1997 merged commit 3e55e92 into main Sep 2, 2026
20 checks passed
@milindsrivastava1997
milindsrivastava1997 deleted the 505-countminsketch-no-heap-ignores-aggregation_sub_type-sumcount-distinction-always-uses-sum-semantics branch September 2, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CountMinSketch (no heap) ignores aggregation_sub_type sum/count distinction, always uses SUM semantics

1 participant